<? $c = sizeof($menu) ?>
<? if ($c > 0):?>
<? $c-- ?>
<div class="menu"></div>
    <ul>
        <? for($i = 0; $i <= $c; $i++): ?>
            <? $cur = in_array($menu[$i]->id, $active) ?>
            <? $class = (($i == $c)?'last ':'').($cur?'current':'')?>
            <li class="<?=  $class ?>">
                <a href="<?= $menu[$i]->url ?>"><?= $menu[$i]->title ?></a>
                <? 
                    $this->widget('DrawMenu', array(
                    'template' => 'SubMenu',
                    'menu' => 'admin',
                    'parent' => $menu[$i]->id 
                    
                ));
                ?>
             </li>  
        <? endfor ?>
      </ul>
<? endif ?>

